package jmine.tec.persist.naturalkey;

/**
 * Converter padrão para natural key, passa o objeto para string.
 * 
 * @author lundberg
 */
public class StringNaturalKeyConverter implements NaturalKeyConverter<String> {

    /**
     * {@inheritDoc}
     */
    public String convert(Object naturalKey) throws InvalidNaturalKeyException {
        return naturalKey == null ? null : naturalKey.toString();
    }

    /**
     * {@inheritDoc}
     */
    public Class<String> getTargetClass() {
        return String.class;
    }
}
